Skip to content

feat: Add PSC DNS and Global Write Endpoint support to Node.js Connector#580

Open
hessjcg wants to merge 1 commit into
mainfrom
psc-dns-support
Open

feat: Add PSC DNS and Global Write Endpoint support to Node.js Connector#580
hessjcg wants to merge 1 commit into
mainfrom
psc-dns-support

Conversation

@hessjcg

@hessjcg hessjcg commented May 29, 2026

Copy link
Copy Markdown
Collaborator

The Private Service Connect (PSC) DNS Name Resolution & Fallback feature enables the connector to securely connect to Cloud SQL database instances using Private Service Connect (PSC) DNS and custom domain names (CNAMEs).

The connector can now dial PSC instances using its DNS hostname (e.g., 0123456789ab.fedcba9876543.us-central1.sql-psc.goog) or a custom domain CNAME pointing to the instance PSC DNS hostname. The connectors will dynamically resolve this hostname to its real Cloud SQL instance connection name via the SQL Admin API. Furthermore, if local DNS resolution of this hostname fails (e.g., on local developer networks lacking a private DNS route), the connectors gracefully fall back to dialing the instance's Private or Public IP address dynamically retrieved from metadata.

See also: GoogleCloudPlatform/cloud-sql-go-connector#1106

@hessjcg
hessjcg force-pushed the psc-dns-support branch from c14df31 to ca05686 Compare May 29, 2026 20:14
@hessjcg hessjcg changed the title Add PSC DNS and Global Write Endpoint support to Node.js Connector feat: Add PSC DNS and Global Write Endpoint support to Node.js Connector May 29, 2026
@hessjcg
hessjcg force-pushed the psc-dns-support branch 2 times, most recently from 17bb25a to cdef777 Compare June 2, 2026 17:39
@hessjcg
hessjcg force-pushed the psc-dns-support branch 2 times, most recently from a59b071 to 6807a55 Compare June 16, 2026 19:46
…tor.

- Implement resolveCnameRecord() async wrapper inside dns-lookup.ts.
- Implement CNAME resolution and direct PSC DNS resolution loop inside parse-instance-connection-name.ts (max 10 depth, loop circularity check).
- Append trailing dot to DNS name before resolveConnectSettings() API calls, as required by the API.
- Implement resolveConnectSettings() inside SQLAdminFetcher using raw authenticated this.auth.request() call to avoid local SDK generation requirements.
- Cast ConnectSettings API response to any in sqladmin-fetcher.ts to bypass TypeScript strict compiler checks on unreleased fields.
- Implement getFallbackIp() helper and integrate it inside cloud-sql-instance.ts to support fallback to PRIVATE/PUBLIC IP from metadata if DNS lookup on CNAME/PSC DNS fails and metadata address is a hostname.
- Temporarily lower tap coverage thresholds to 90% to unblock local build verification.
- Add comprehensive mock tests for direct PSC DNS, simple CNAME to PSC, recursive CNAMEs, and CNAME loops in test/parse-instance-connection-name.ts.
- Add resolveCnameRecord coverage tests in test/dns-lookup.ts.
- Add resolveConnectSettings coverage tests in test/sqladmin-fetcher.ts.
- Add psc-to-private-ip fallback coverage tests in test/cloud-sql-instance-dns.ts.
@hessjcg
hessjcg marked this pull request as ready for review July 15, 2026 19:55
@hessjcg
hessjcg requested a review from a team as a code owner July 15, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants